package com.itlong.cloud.project.operate;

import com.itlong.cloud.POJO.DTO.operate.OperateProductTypeGetPageDTO;
import com.itlong.cloud.POJO.DTO.operate.OperateProductTypeSaveDTO;
import com.itlong.cloud.POJO.VO.operate.OperateProductTypeDetailVO;
import com.itlong.cloud.POJO.VO.operate.OperateProductTypeVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <desc>
 *      产品型号信息服务协议接口
 * </desc>
 *
 * @createDate 2017-10-13.
 */
@FeignClient(name = "project-service")
public interface IOperateProductTypeServiceClient {

    /**
     * <desc>
     *      检测产品型号存在性
     * <desc/>
     *
     * @param typePid 产品型号Pid
     * @return 同型号Pid的个数
     * @author Chunjian.G
     * @createDate 2017-10-26
     */
    @RequestMapping(path = "/operate/project/productType/exist", method = {RequestMethod.POST})
    Integer checkProductExist(@RequestParam(name = "typePid") String typePid) throws Exception;

    /**
     * <desc>
     *      添加单个产品型号
     * <desc/>
     *
     * @param saveDTO 新增产品型号信息
     * @return
     * @author Chunjian.G
     * @createDate 2017-10-13
     */
    @RequestMapping(path = "/operate/project/productType/add", method = {RequestMethod.POST})
    Integer saveProductType(@RequestBody OperateProductTypeSaveDTO saveDTO) throws Exception;

    /**
     * <desc>
     *      更新单个产品型号
     * <desc/>
     *
     * @param updateDTO 产品型号更新信息
     * @return
     * @author Chunjian.G
     * @createDate 2017-10-13
     */
    @RequestMapping(path = "/operate/project/productType/update", method = {RequestMethod.POST})
    Integer updateProductType(@RequestBody OperateProductTypeSaveDTO updateDTO) throws Exception;

    /**
     * <desc>
     *      查询是否有项目关联设备类型
     * <desc/>
     *
     * @param typePid 型号ID
     * @return
     * @author Qiang.S
     * @createDate 2018-07-25
     */
    @RequestMapping(path = "/operate/project/productType/getProductCount", method = {RequestMethod.POST})
    Integer getProductCount(@RequestParam(name = "typePid") String typePid) throws Exception;

    /**
     * <desc>
     *      删除产品型号
     * <desc/>
     *
     * @param typePid 型号ID
     * @return
     * @author Chunjian.G
     * @createDate 2017-10-13
     */
    @RequestMapping(path = "/operate/project/productType/del", method = {RequestMethod.POST})
    Integer removeProductType(@RequestParam(name = "typePid") String typePid) throws Exception;

    /**
     * <desc>
     *      分页查询产品型号简易信息列表
     * <desc/>
     *
     * @param pageDTO 分页查询参数
     * @return
     * @author Chunjian.G
     * @createDate 2017-10-13
     */
    @RequestMapping(path = "/operate/project/productType/getPage", method = {RequestMethod.POST})
    Page<OperateProductTypeVO> getPage(@RequestBody OperateProductTypeGetPageDTO pageDTO) throws Exception;

    /**
     * <desc>
     *      查询单个产品型号详情
     * <desc/>
     *
     * @param typePid 型号ID
     * @return
     * @author Chunjian.G
     * @createDate 2017-10-13
     */
    @RequestMapping(name = "/operate/project/productType/getDetail", method = {RequestMethod.POST})
    OperateProductTypeDetailVO getDetail(@RequestParam(name = "typePid") String typePid) throws Exception;


    /**
     * <desc>
     *      检测是否存在云电梯的产品。
     * <desc/>
     *
     * @param deviceType 设备类型
     * @param typeCode 型号代号
     * @return
     * @author shengen.T
     * @createDate 2018-04-17
     */
    @RequestMapping(path = "/operate/project/productType/checkCloudElevatorExist")
    Integer checkCloudElevatorExist(@RequestParam("deviceType") Integer deviceType, @RequestParam("typeCode") String typeCode) throws Exception;

}
